package com.ybkj.o2o.zhuanche.service.impl;

import java.util.List;

import com.ybkj.o2o.zhuanche.common.query.InsuranceQuery;
import com.ybkj.o2o.zhuanche.entity.Insurance;
import com.ybkj.o2o.zhuanche.mapper.InsuranceMapper;
import com.ybkj.o2o.zhuanche.service.InsuranceService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class DefaultInsuranceService implements InsuranceService {
	@Autowired
	private InsuranceMapper insuranceMapper;

	@Override
	public int save(Insurance insurance) {
		return insuranceMapper.insert(insurance);
	}

	@Override
	public List<Insurance> selectByCarId(InsuranceQuery insuranceQuery) {
		return insuranceMapper.selectByCarId(insuranceQuery);
	}

	@Override
	public Long countByCarId(InsuranceQuery insuranceQuery) {

		return insuranceMapper.countByCarId(insuranceQuery);
	}

	@Override
	public int deleteById(Long id, String appKey) {
		return insuranceMapper.deleteById(id,appKey);
	}

	@Override public Insurance findById(Long id, String appKey) {
		return insuranceMapper.findById(id,appKey);
	}

	@Override
	public List<Insurance> findByCarId(Long carId, String appKey) {
		return insuranceMapper.findByCarId(carId,appKey);
	}
}
